/*
 * Calendar.java
 *
 * Created on August 15, 2006, 4:28 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package calendarapplication;

import java.util.*;

/**
 *
 * @author eddie.dillon
 */
public class Calendar extends GregorianCalendar {
    
    private ArrayList<Day>_days = new ArrayList<Day>();
    
    /** Creates a new instance of Calendar */
    public Calendar() {
        Date today = new Date();
        this.setGregorianChange(today);
    }
    
    public int Year(){
        return this.YEAR;
    }
    
    public int Day(){
        return this.DAY_OF_MONTH;
    }
    
    public int Month(){
        return this.MONTH;
    }
   
    //Gets Day objects into a list based on the current month
    public ArrayList<Day> GetDays(){
        int days = getActualMaximum(Calendar.DAY_OF_MONTH);
        for (int i = 0; i < days; i++) {
            Day day = new Day();
            _days.add(day);
        }
        return _days;
    }
    
    public int GetWeeksInMonth() {
        return getActualMaximum(Calendar.WEEK_OF_MONTH);
    }
    
    public int GetNextYear(){
        return this.YEAR + 1;
    }
    
    public int GetPrevYear(){
        return this.YEAR - 1;
    }
}
